package edu.wayne.cs.csc4110.hw6.plugins.example.maze;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;

public class Mouse {

	private Point center;
	private int speed = 10;

	public Mouse(){

		center = new Point(0,0);
	}
	
	public enum Direction{
		NORTH, EAST, SOUTH, WEST
	}

	public void moveDirection(Direction d){
		Point newPoint = null;
		switch(d){
		case NORTH:
			newPoint = new Point(center.x, center.y-speed);
			break;
		case EAST:
			newPoint = new Point(center.x+speed, center.y);
			break;
		case SOUTH:
			newPoint = new Point(center.x, center.y+speed);
			break;
		case WEST:
			newPoint = new Point(center.x-speed, center.y);
			break;
		}
		if(newPoint!=null){
			center.setLocation(newPoint);
		}
	}
	public void draw(Graphics g){
		g.setColor(Color.RED);
		g.drawOval(center.x, center.y, 5, 5);
		g.setColor(Color.RED);
		g.fillOval(center.x, center.y, 5, 5);
	}
	
	public void restart(){
		center.setLocation(0,0);
	}
}
